<% reply_id = "note#{proposal_note.id}-reply" %>

<div class="comment">
  <div class="comment__header">
    <%= cell "decidim/author", present(proposal_note.author), from: proposal_note, context_actions: [:date], tooltip: false, show_icons: false %>
  </div>

  <div class="comment__content">
    <%= simple_format proposal_note.formatted_body %>
  </div>

  <div class="comment-actions">
    <button class="button button__sm button__text-secondary" data-controls="panel-<%= reply_id %>" id="panel-<%= reply_id %>-trigger">
      <%= icon "chat-1-line" %>
      <span class="font-normal"><%= t("decidim.components.comment.reply") %></span>
      <%= icon "close-circle-line" %>
      <span class="font-normal"><%= t("decidim.components.comment.cancel_reply") %></span>
    </button>
  </div>

  <div class="mt-6 space-y-2">
    <%= render partial: "decidim/proposals/admin/proposal_notes/proposal_note_reply", collection: proposal_note.replies %>
  </div>

  <div id="panel-<%= reply_id %>" class="add-comment" data-additional-reply>
    <%= render partial: "decidim/proposals/admin/proposal_notes/form", locals: { form_path: reply_proposal_proposal_note_path(proposal, proposal_note, @notes_form) } %>
  </div>
</div>
